package com.baizan.daka.ui.adapter

import android.widget.TextView
import com.baizan.daka.mvp.model.bean.PayChannelBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.dianzan.daka.R

class PayChannelAdapter : BaseQuickAdapter<PayChannelBean, BaseViewHolder>(R.layout.item_pay_channel) {

     var index: Int = 0
     fun getIndexBean():PayChannelBean = data[index]

    override fun convert(helper: BaseViewHolder, item: PayChannelBean) {
        var textView = helper.getView<TextView>(R.id.alipay_tv)
        textView.text = item.channelName
        textView.isSelected = index == helper.adapterPosition
        textView.setOnClickListener {
            index = helper.adapterPosition
            notifyDataSetChanged()
        }
    }


}